package com.cy.pj.sys.dao;

import com.cy.pj.common.pojo.SysUser;
import com.cy.pj.common.pojo.SysUserDeptVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Cx
 * @stage secondStageOfWeb
 * @creat 2020-11-18 10:24
 */
@Mapper
public interface SysUserDao {

    SysUser findUserByUserName(String username);

    int updatePassword(
            @Param("password") String password,
            @Param("salt") String salt,
            @Param("id") Integer id);

    int updateObject(SysUser entity);

    SysUserDeptVo findObjectById(Integer id);

    int insertObject(SysUser entity);

    int validById(
            @Param("id") Integer id,
            @Param("valid") Integer valid,
            @Param("modifiedUser") String modifiedUser);

    int getRowCount(String username); /* 该方法用于按条件统计记录总数 */

    List<SysUserDeptVo> findPageObjects(
            String username,
            Integer startIndex,
            Integer pageSize); /* 该方法实现当前页记录的数据查询操作 */

}
